home *** CD-ROM | disk | FTP | other *** search
- // Utils.prg
- //
- // Utility routines for TBrowse
-
- #include "InKey.ch"
-
- // Default column separator
- #define DEF_CSEP " " + chr(179) + " "
-
- // Default heading separator
- #define DEF_HSEP chr(205) + chr(209) + chr(205)
-
- // Default footing separator
- #define DEF_FSEP chr(205) + chr(207) + chr(205)
-
- FUNCTION StdMeth(oTbr, nKey)
-
- LOCAL lKeyHandled := .T.
-
- DO CASE
- CASE nKey == K_UP; oTbr:up()
- CASE nKey == K_DOWN; oTbr:down()
- CASE nKey == K_PGUP; oTbr:pageUp()
- CASE nKey == K_PGDN; oTbr:pageDown()
- CASE nKey == K_RIGHT; oTbr:right()
- CASE nKey == K_LEFT; oTbr:left()
- CASE nKey == K_HOME; oTbr:home()
- CASE nKey == K_CTRL_PGUP; oTbr:goTop()
- CASE nKey == K_CTRL_PGDN; oTbr:goBottom()
- CASE nKey == K_END; oTbr:end()
- OTHERWISE; lKeyHandled := .F.
- ENDCASE
-
- RETURN lKeyHandled
-
-
- FUNCTION TbInit(oTbr, nTop, nLeft, nBottom, nRight)
-
- oTbr:colSep := DEF_CSEP
- oTbr:headSep := DEF_HSEP
- oTbr:footSep := DEF_FSEP
-
- oTbr:nTop := nTop
- oTbr:nLeft := nLeft
- oTbr:nBottom := nBottom
- oTbr:nRight := nRight
-
- RETURN NIL